home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
mint
/
lib
/
mntlib44.zoo
/
mntlib
/
strdup.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-17
|
294b
|
21 lines
/*
* strdup: return a duplicate of a string
* Written by Eric R. Smith and placed in the public domain.
*/
#include <stdlib.h>
#include <string.h>
#undef strdup
char *
strdup(s)
const char *s;
{
char *dup;
dup = (char *) malloc(strlen(s)+1);
if (dup)
strcpy(dup, s);
return dup;
}